export function addClass (target, name) {
  if (hasclass(target, name)) {
    return false
  }
  let newclass = target.className.split(' ')
  newclass.push(name)
  target.className = newclass.join(' ')
}
// 判断是否有此类名
export function hasclass (target, name) {
  let reg = new RegExp('(^|\\s)' + name + '(\\s|$)')
  return reg.test(target.className)
}
